﻿
@{
    string aid = ViewBag.aid as string;
    Layout = null;
}


<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no" />
    <title>@ViewBag.Title</title>
    <link href="/css/style.css" rel="stylesheet" />
    <link href="/css/swipper.css" rel="stylesheet" />
    <link href="/css/preload.css" rel="stylesheet" />
    <link href="/css/loading.css" rel="stylesheet" />
    <script src="/js/jquery-1.7.2.min.js"></script>
    <script src="/js/clipboard.min.js"></script>
    <script type="text/javascript">
        var limit = 1;
    </script>
    
    <script>
        var deviceWidth = document.documentElement.clientWidth;
        if (deviceWidth > 750) deviceWidth = 750;
        document.documentElement.style.fontSize = deviceWidth / 7.5 + "px";
        document.documentElement.style.width = "100%";
    </script>
    <script src="/js/htool.js"></script>
    <script src="/js/asynloading.js"></script>
</head>
<body>
    <div id="containter" class="container">
      
        <div class="list_sel listfk">
            <div class="list_sel2">
                <div class="index_navbar swiper-wrapper">
                   @Html.Raw(ViewBag.OrderHtml as string)
                </div>
            </div>
        </div>
       
        <!--固定的-->
        <div class="tiger_nav1" id="head_seach">
            <div class="seach_nav">
                <div class="seach_1" onclick="javascript:history.go(-1);return false;"></div>
                <div class="seach_2">
                    <form id="search-form">
                       
                        <input type="text" id="key" name="key" value="@(ViewBag.Key  as string)" class="tige_sear" />
                        <button id="tiger_search-submit" type="submit" onclick="searchan()"><img src="/images/search.png" /></button>
                    </form>
                </div>
                <div class="seach_3" onclick="javascript: window.location.href = '/@(aid)';"></div>
            </div>
        </div>

        <!--固定的结束-->
        <!--浮动导航-->
      
        <div class="tiger_bj" id="tiger_bj" style="display:none" onclick="colok()"></div>
        <div class="tiger_nav" id="pf_seach" style="display:none">
            <div class="seach_nav">
                <div class="seach_1" onclick="javascript:history.go(-1);return false;"></div>
                <div class="seach_2">
                    <form id="search-form">
                        <input type="text" id="key" name="key" value="@(ViewBag.Key  as string)" class="tige_sear" />
                        <button id="tiger_search-submit" type="submit" onclick="searchan()"><img src="/images/search.png" /></button>
                    </form>
                </div>
                <div class="seach_3" onclick="javascript: window.location.href = '/@(aid)';"></div>
            </div>
            <div class="nav_tab">
                <div class="nav_1 tcon nav_ty" onclick="tiger_nva(1)"><span id="s1">全部分类</span><i class="arrow-icon" id="a1"></i></div>
                <div class="nav_2 tcon boleft nav_ty" onclick="tiger_nva(2)"><span id="s2">商品排序</span><i class="arrow-icon" id="a2"></i></div>
                <div class="nav_3 tcon boleft nav_ty" onclick="tiger_nva(3)"><span id="s3">筛选</span><i class="arrow-icon" id="a3"></i></div>
                <div class="nav_4 tcon boleft nav_ty" onclick="gzrwm()"><img src="/images/tiger_ewm.png" style="width:17px;height:17px"></div>
            </div>
        </div>
        <!--浮动导航结束-->
        <!--TAB-->
        <div class="tiger_nav_list1" id="cd1" style="display:none">
            <ul>
                <li><a href="/@(aid)/c_1.html">女装</a></li>
                <li><a href="/@(aid)/c_7.html">母婴</a></li>
                <li><a href="/@(aid)/c_6.html">美妆</a></li>
                <li><a href="/@(aid)/c_12.html">居家</a></li>
                <li><a href="/@(aid)/c_4.html">配饰</a></li>
                <li><a href="/@(aid)/c_8.html">美食</a></li>
                <li><a href="/@(aid)/c_5.html">运动</a></li>
                <li><a href="/@(aid)/c_13.html">家电</a></li>
                <li><a href="/@(aid)/c_10.1html">数码</a></li>
                <li><a href="/@(aid)/c_2.html">男装</a></li>
                <li><a href="/@(aid)/c_9.html">内衣</a></li>
                <li><a href="/@(aid)/c_3.html">鞋包</a></li>
                <li><a href="/@(aid)/c_11.html">家装</a></li>
                <li><a href="/@(aid)/c_14.html">汽车</a></li>
                <li><a href="/@(aid)/c_15.html">生活服务</a></li>
                <li><a href="/@(aid)/c_16.html">图书音像</a></li>
                <li><a href="/@(aid)/c_17.html">游戏话费</a></li>
                <li><a href="/@(aid)/c_64.html">其它</a></li>
            </ul>
        </div>
        <div class="tiger_nav_list2" id="cd2" style="display:none">
            <ul>
               
               @Html.Raw(ViewBag.Html as string)
            </ul>
        </div>
        <div class="tiger_nav_list3" id="cd3" style="display:none">
            <input type="hidden" name="op" value="seach">
            <div class="jl_0">价格区间(元)</div>
            <input name="endprice" id="endprice" type="number" class="jl_1" value="@(ViewBag.endprice as string)" placeholder="0">
            <div class="jl_2"></div>
            <input name="strprice" id="strprice" type="number" class="jl_1" value="@(ViewBag.strprice as string)" placeholder="0">
            <div class="clear"></div>
            <div class="jl_3">
                <div class="jl_an" id="seachprice">确认搜索</div>
            </div>
        </div>

        <script>

    function search() {
        var key = $('#key').val();
        var strprice = $('#strprice').val();
        var endprice = $('#endprice').val();

                @{string Url = ViewBag.Url as string; Url = string.IsNullOrEmpty(Url) ? "/sc.html" : Url;}

        parent.location.href = "/@(aid)/sc.html?key=" + $('#key').val() + "&strprice=" + strprice + "&endprice=" + endprice;

            }
            $(function () {


                $("#tiger_search-submit").on("click", function () {
                    search();
                });
                $("#seachprice").on("click", function () {
                    search();
                });
                $('#key').keydown(function (e) {
                    if (e.keyCode == 13) {
                        search()
                    }
                });
            });

            function searchan() {
                search();
            }

        </script>
        <link href="/css/nav.css" rel="stylesheet" />
        <script src="/js/nav.js"></script>
        <!--TAB结束-->


        <div class="goods_list" style="margin-top:0;">
            <section class="goods" id="pageCon">
                <ul id="list_box" class="list_box"></ul>
            </section>
            <div id="list_more" class="loading1" style="margin-top:10px;text-align:center;padding-bottom:60px;">
                <span onclick="get_list(0);">查看更多</span>
            </div>
        </div>
    </div>
    @Html.Hidden("cid", ViewBag.classid as string)
    @Html.Hidden("type", ViewBag.type as string)
    @Html.Hidden("Key", ViewBag.Key as string)
    @Html.Hidden("sort", ViewBag.sort as string)
    <link rel="stylesheet" href="/css/dropload.css">
    <script src="/js/dropload.min.js"></script>
    <script type="text/javascript">

        var limit = 1;
        function get_list(ty) {
            var tj = '1';
            if (ty == 1) {
                $("#pageCon .list_box").html('');
            } else {
                $("#list_more").html('<div class="loading1"><span > 卖命加载中...</span></div>');
            }

            $.ajax({
                type: "post",
                url: "/@(aid)/goods.html",
                data: {
                    limit: limit,
                    cid: $("#cid").val(),
                    type: $("#type").val(),
                    Key: $("#Key").val(),
                    sort: $("#sort").val(),
                    strprice:$("#strprice").val(),
                    endprice:$("#endprice").val()
                    
                },
                dataType: "json",
                success: function (dd) {
                    if (dd.rows.CurrentPageList != null) {
                        var list = dd.rows.CurrentPageList;
                        var htm = "";
                        var content = '';
                        for (var i = 0; i < list.length; i++)
                        {
                            content += '<li class="relative">';
                            content += '<div class="goods_pic">';
                            content += '<a href="/@(aid)/p_' + list[i].auctionId + '.html" >';
                            content += '<div class="allpreContainer">';
                            content += '<div class="inoutbg" style="background-image: url(' + list[i].pictUrl + '); background-size: cover; background-position: 50% 50%; background-repeat: no-repeat;">';
                            content += '</div>';
                            content += '<img class="preloadbg" src-data="' + list[i].pictUrl + '" src="" loaded="false">';
                            content += '<div class="DSbg" style="background-size: cover; background-position: 50% 50%; background-repeat: no-repeat;">';
                            content += '</div>';
                            content += '</div>';
                            content += '</a>';
                            content += '</div>';
                            content += '<div class="goods_bottom">';
                            content += '<div>';
                            content += '<a class="goods_text" href="/@(aid)/p_' + list[i].auctionId + '.html">' + list[i].title + '</a>';
                            content += '</div>';
                            if (list[i].userType == 1) {
                                content += '<div class="comefrom">去天猫</div>';
                            } else {
                                content += '<div class="comefrom" style="    background: url(/images/taobao.png) no-repeat left center/15px;">去淘宝</div>';
                            }
                            content += '<div style=" position: absolute;top:60px;left: 10px;font-size:12px;">销量：' + list[i].biz30day + '</div>';
                            content += '<div style=" position: absolute;top:73px;left: 10px;font-size:12px;">原价：&yen;' + list[i].zkPrice + '</div>';
                            content += '<div class="goodspc">';
                            content += '<div class="goods_price">';
                            content += '<span style="font-size:12px;">券后价:</span><span>' + (list[i].zkPrice - list[i].couponAmount).toFixed(2) + '</span>';
                            content += '</div>';
                            if (tj == 3) {
                                content += '<a href="javascript:;" class="new-coupon" data-img="' + list[i].pictUrl + '" data-openid="" data-dluid="0"  data-rxyjxs="1" data-id="' + list[i].auctionId + '" data-url="' + list[i].auctionUrl + '"  data-numiid="' + list[i].auctionId + '" data-orgprice="' + list[i].zkPrice + '"  data-price="' + (list[i].zkPrice - list[i].couponAmount) + '" coupons_price="' + list[i].couponAmount + '" data-title="' + list[i].title + '" data-tkrate="0"><span>秒杀领券</span><span>立减<em class="ljmoney">' + list[i].couponAmount + '</em>元</span></a>';
                            } else {
                                content += '<a href="javascript:;" class="new-coupon" data-img="' + list[i].pictUrl + '" data-openid="" data-dluid="0"  data-rxyjxs="1" data-id="' + list[i].auctionId + '" data-url="' + list[i].auctionUrl + '"  data-numiid="' + list[i].auctionId + '" data-orgprice="' + list[i].zkPrice + '" data-price="' + (list[i].zkPrice - list[i].couponAmount) + '" coupons_price="' + list[i].couponAmount + '" data-title="' + list[i].title + '" data-tkrate="0"><span>马上领劵</span><span>立减<em class="ljmoney">' + list[i].couponAmount + '</em>元</span></a>';
                            }
                            content += '</div>';
                            content += '</div>';
                            content += '</li>';
                        }
                        $("#pageCon .list_box").append(content);
                        var aa = $(".goods-list li").innerWidth();
                        $(".goods-list li img").css('height', aa);
                        if (list.length > 1) {
                            $("#list_more").html('<span onclick="get_list(0);">点击查看更多</span>');
                        } else {
                            $("#list_more").html('<span></span>');
                        }
                        limit++;




                        //waterfall();
                        //lazy_img();
                    } else if (data.status == 2) {
                        $("#list_more").html('<span>没有更多记录！</span>');
                        //dialog("没有更多记录！");
                        //$("#list_more").fadeOut(500);

                    } else {
                        $("#list_more").html('<span>没有更多记录！</span>');
                        //dialog("没有更多记录！！");
                        //$("#list_more").fadeOut(500);
                    }
                },
                error: function (xhr, type) {

                }
            });


        }
        //get_list(0);
        if (window.localStorage.getItem("url") == window.location.href && window.localStorage.getItem("top") != "null")
        { }
        else
        {
            get_list(0);
        }

        //==============自动加载=============
        //获取滚动条当前的位置
        function getScrollTop() {
            var scrollTop = 0;
            if (document.documentElement && document.documentElement.scrollTop) {
                scrollTop = document.documentElement.scrollTop;
            }
            else if (document.body) {
                scrollTop = document.body.scrollTop;
            }
            return scrollTop;
        }

        //获取当前可是范围的高度
        function getClientHeight() {
            var clientHeight = 0;
            if (document.body.clientHeight && document.documentElement.clientHeight) {
                clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight);
            }
            else {
                clientHeight = Math.max(document.body.clientHeight, document.documentElement.clientHeight);
            }
            return clientHeight;
        }

        //获取文档完整的高度
        function getScrollHeight() {
            return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
        }


        $(window).scroll(function () {
            if (getScrollTop() + getClientHeight() == getScrollHeight()) {
                //alert("到达底部");
                get_list(0);
            }
        });

        //==============自动加载=============


        function waterfall(limit) {
            $container = $('#list_box');
            $container.masonry('reload');
            $container.imagesLoaded(function () {
                lazy_img();
                $container.masonry({
                    itemSelector: '.picCon',
                    isFitWidth: false,//是否根据浏览器窗口大小自动适应默认false
                    //gutter: 20,
                    isAnimated: false,//是否采用jquery动画进行重拍版
                    isRTL: false,//设置布局的排列方式，即：定位砖块时，是从左向右排列还是从右向左排列。默认值为false，即从左向右
                    isResizable: true,//是否自动布局默认true
                });
            });
        }



    </script>

    <!--底部菜单开始-->


    @Html.Partial("_menu")
    <!--底部菜单结束-->
 
</body>
</html>
<script>
    var weid = "3";
</script>
<script src="/js/idangerous.swiper.min.js"></script>
<script src="/js/common_phone.js"></script>
<script src="/js/fun.js"></script>
<script src="/js/dataload.js"></script>
<script src="http://cs.youqi18.com/addons/tiger_taoke/template/mobile/js/layer_mobile/layer.js"></script>

<script>
    function gzrwm() {

        layer.open({
            type: 1,
            title: '- 长按识别关注 -',
            skin: 'layui-layer-demo',
            closeBtn: 0,
            anim: 2,
            shadeClose: true,
            content: "<img src='/images/AeZBVZ262kEeAekEDAWKL3DwxNLDDI.jpg' style='width:300px;height:300px;'>"
        });

    }
</script>

<script>
    $(document).ready(function () {
        var swiper3;
        if ($(window).width() < 375) {
            swiper3 = new Swiper('.swiper3', {
                slidesPerView: 3.3,
                paginationClickable: true,
                freeMode: true,
                initialSlide: $(".swiper3").find(".cur").index()
            });
        } else {
            swiper3 = new Swiper('.swiper3', {
                slidesPerView: 4,
                paginationClickable: true,
                freeMode: true,
                initialSlide: $(".swiper3").find(".cur").index()
            });
        }
    });
</script>
<script type="text/javascript">
    $(function () {
        var clipboard = new Clipboard(".taokaocopy", {
            text: function () {
                return $(".copybox1").val();
            }
        });

        clipboard.on('success', function (e) {
            //alert("链接已复制到剪贴板");
            $(".taokaocopy").html("<img src='/images/copy1.png'>");
        });

        clipboard.on('error', function (e) {
            //console.log(e);
            $(".taokaocopy").html("<img src='/images/copy2.png'>");
        })
    });
</script>


